package com.eet.message.handler.topic;

import com.eet.message.handler.MessageHandler;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * Topic邮件
 *
 * @author zheng.zhang
 */

@Component
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "topic.sms.queue", durable = "true", autoDelete = "false"),
        exchange = @Exchange(value = "topic_order_exchange", type = ExchangeTypes.TOPIC),
        key = "#.sms.#"
))
public class TopicSmsHandler implements MessageHandler {

    @Override
    @RabbitHandler
    public void receiveMessage(String message) {
        System.out.println("发送短信-->收到的消息为: " + message);
    }
}
